function loadProfile(userId) {
	
	var profileForm = Ext.create('Ext.form.Panel', {
		renderTo : "profileDiv",
		width : '100%',
		margin : '25 5 5 10',
		buttonAlign : 'left',
		//autoScroll : !!true,
		border : 0,
		trackResetOnLoad: true, 
		layout : {
			type : 'table',
			columns : 3
		},
		/*
		 * defaults : { height : 500, width : 400 },
		 */
		items : [{
					xtype : 'textfield',
					fieldLabel : 'First Name',
					name : 'firstName',
					allowBlank : false
				}, {
					xtype : 'textfield',
					fieldLabel : 'Last Name',
					name : 'lastName',
					allowBlank : false
				}, {
					xtype : 'datefield',
					fieldLabel : 'Date of birth',
					name : 'dob'
				}, {
					xtype : 'textfield',
					fieldLabel : 'Email id',
					vtype : 'email',
					name : 'emailId',
					colspan : 3,
					allowBlank : false
				}, {
					xtype : 'splitter',
					colspan : 3
				}, {
					xtype : 'splitter',
					colspan : 3
				}, {
					xtype : 'splitter',
					colspan : 3
				}, {
					xtype : 'tabpanel',
					colspan : 3,
					plain : true,

					items : [{
								title : 'Personal',
								bodyPadding : 10,
								html : 'Personal'
							}, {
								title : 'Educational',
								html : 'Educational'
							}, {
								title : 'Professional',
								html : 'Educational'
							}]
				}, {
					xtype : 'hiddenfield',
					name : 'id'
				}

		],
		buttons : [{
					text : 'Reset',
					handler : function() {
						this.up('form').getForm().reset();
					}
				}, {
					text : 'Submit',
					//formBind : true, // only enabled once the form is valid
					//disabled : true,
					handler : function() {
						var form = this.up('form').getForm();
						record = form.getValues();
						if(!form.isValid()) {
							Ext.getCmp("messageBar").setStatus("Form data is invalid. Please correct the errors");
						}
						else {
							Ext.getCmp("messageBar").setStatus("Saving User profile information...");
							form.submit({
								url : '../user/save.json', 
								params : {
									record : Ext.JSON.encode(record)
								},
								success : function(form, action) {
									Ext.getCmp("messageBar").setStatus("User changes saved");
								},
								failure : function(form, action) {	
									//alert(action.result.message);
									Ext.getCmp("messageBar").setStatus(action.result.message);
									/*if (action.failureType == Ext.form.Action.CONNECT_FAILURE) {
										Ext.Msg
												.alert(
														'Failure',
														'Server reported:'
																+ action.response.status
																+ ' '
																+ action.response.statusText);
									}
									if (action.failureType == Ext.form.Action.SERVER_INVALID) {
										Ext.Msg.alert('Warning',
												action.result.errormsg);
									}

									Ext.Msg.alert('Failure', 'Server reported:'
													+ action.failureType);*/

								}
							});
						}
					}
				}]
	});

	profileForm.getForm().load({
				url : '../user/editProfile/' + userId + '.json',
				method : 'GET',
				success : function(form, action) {
					// Ext.Msg.alert('Success', action.result.msg);
				},
				failure : function(form, action) {
					// Ext.Msg.alert('Failure', action.result.msg);
				}
			});
}